﻿#include<stdio.h>
int missingNumber(int* nums, int numsize)
{
	int sum = 0;
	int n = numsize + 1;
	for (int i = 0; i < n; i++)
	{
		sum += i;
	}
	for (int i = 0; i < numsize; i++)
	{
		sum -= nums[i];
	}
	return sum;
}
int main()
{
	int nums[] = { 9,6,4,2,3,5,7,0,1 };
	int numsize = sizeof(nums) / sizeof(nums[0]);
	int ret = missingNumber(nums, numsize);
	printf("%d",ret);
	return 0;
}